#include"purchaseRecord.h"
#include<string.h>
#include<iomanip>

purchaseRecord::purchaseRecord(string nameOfuser,string nameOfBook,string purchaseTime,double cost,string advise)
{
    this->m_nameOfuser = nameOfuser;
    this->m_nameOfBook = nameOfBook;
    this->m_purchaseTime = purchaseTime;
    this->m_cost = cost;
    this->m_advise = advise;
}

ostream& operator<<(ostream& out,purchaseRecord &p)
{
    out<<left<<setw(10)<<p.m_nameOfuser<<left<<setw(10)<<p.m_nameOfBook<<
            left<<setw(25)<<p.m_purchaseTime<<left<<setw(10)<<p.m_cost<<left<<setw(25)<<p.m_advise;
    return out;
}

void purchaseRecord::shouPurchaseRecord()
{
    cout<<(*this)<<endl;
}